@extends('layouts.mobile_main')

@section('title', '评论列表')

@section('resources')
    @parent
    <link rel="stylesheet" href="{{ env('CSS_DOMAIN') }}css/public.css?v={{env('CSS_VERSION')}}">
    <link rel="stylesheet" href="{{env('CSS_DOMAIN')}}css/check.css?v={{env('CSS_VERSION')}}">
    <script src="{{ env('JS_DOMAIN') }}js/adaptation.js?v={{env('JS_VERSION')}}"></script>
@endsection

@section('content')
<div class="paysu_outer">
   	<header class="pay_sure oh" style="background-color: #fff;position: fixed;top: 0;left: 0;">
   		<a class="fl" href="javascript:history.go(-1);">
   		    <img class="fl" src="{{env('IMAGE_DOMAIN')}}images/back_p.png?v={{env('IMAGE_VERSION')}}" alt="">
   		</a>
   		<span class="fl co_violet fz_48">用户评价</span>
   	</header>
   	<p class="evaluate_choose oh">
   		<span class="fl fz_40 co_violet" style="border-bottom: 4px solid #9955c6;">全部评论</span>
   		<span class="fl fz_40 co_gray">晒图评论</span>
   	</p>
   	<ul class="evaluate_list">
   	    @foreach($lists as $list)
            <li>
                <div class="oh">
                @if(strstr($list['useravatar'], 'http'))
                    <img class="fl head_pic" src="{{$list['useravatar']}}" alt="">
                @else
                    <img class="fl head_pic" src="{{env('IMAGE_DOMAIN')}}{{$list['useravatar']}}" alt="">
                @endif
                    <div class="fl">
                        <p class="fz_40"></p>
                        <p class="fz_28 co_gray" style="margin-top: 0.3rem;">{{date('Y-m-d', strtotime($list['commenttime']))}}</p>
                    </div>
                    <p class="evaluate_score fr">
                        @if($list['score'] <=1)
                            <img src="{{env('IMAGE_DOMAIN')}}images/half.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>1) && ($list['score'] <=2))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>2) && ($list['score'] <=3))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/half.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>3) && ($list['score'] <=4))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>4) && ($list['score'] <=5))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/half.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>5) && ($list['score'] <=6))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>6) && ($list['score'] <=7))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/half.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>7) && ($list['score'] <=8))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/empty.png" alt="">
                        @elseif(($list['score']>8) && ($list['score'] <=9))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/half.png" alt="">
                        @elseif(($list['score']>9) && ($list['score'] <=10))
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                            <img src="{{env('IMAGE_DOMAIN')}}images/enter.png" alt="">
                        @endif
                        <span class="fz_34 co_star">{{$list['score']}}分</span>
                    </p>
                </div>
                <div class="fz_34 evaluate_text">
              <p>{{$list['content']}}</p>
            </div>
                <p class="evaluate_imgsc">

                </p>
            </li>
   		@endforeach
   	</ul>
</div>
@endsection

@section("scriptResources")
    @parent
    <script src="{{ env('JS_DOMAIN') }}js/banner.js?v={{env('JS_VERSION')}}"></script>
    <script src="{{ env('JS_DOMAIN') }}jsinclude.js?v={{env('JS_VERSION')}}"></script>
    <script>
       	window.onresize=function(){
       		pagesp();
       	}
       	$(function(){
       		var paysu_outer_h=$(window).height();
       		var pay_sure=$(".pay_sure").height();
       		var evaluate_choose=$(".evaluate_choose").height();
       		$(".paysu_outer").css({"min-height":paysu_outer_h-pay_sure-1-evaluate_choose-2});
       		$(".evaluate_list").css({"margin-top":pay_sure+1+evaluate_choose+1});
       		for (var i = 0; i < $(".evaluate_text").length; i++) {
       			if($(".evaluate_text").children('p').eq(i).html().length>60){
       				var nearby_busyhtml=$(".evaluate_text").children('p').eq(i).html().substring(0,60);
       				$(".evaluate_text").children('p').eq(i).html(nearby_busyhtml+"...");
       				$(".evaluate_text").eq(i).append('<span class="fz_34 openup co_violet">展开全文</span>');
       			}
       		};
          var kaiguan='off';
       		$(".openup").click(function(){
            if(kaiguan=='off'){
              $(this).parent(".evaluate_text").children('p').html("");
              $(this).html('收起');
              kaiguan='on';
            }else{
              var nearby_busyhtml=$(this).parent(".evaluate_text").children('p').html().substring(0,60);
              $(this).parent(".evaluate_text").children('p').html(nearby_busyhtml+"...");
              $(this).html('展开全文');
              kaiguan='off';
            }
       		})
            // $(".closedown").click(function(){
            //   for (var i = 0; i < $(".evaluate_text").length; i++) {
            //     if($(".evaluate_text").eq(i).html().length>60){
            //       var nearby_busyhtml=$(".evaluate_text").eq(i).html().substring(0,60);
            //       $(".evaluate_text").eq(i).html(nearby_busyhtml+"...");
            //       $(".evaluate_text").eq(i).append('<span class="fz_34 openup co_violet">全文</span>');
            //     }
            //   };
            // })
       		$(".evaluate_choose span").click(function(){
       			$(this).css({"color":"#9a54c6","border-bottom":"4px solid #9955c6"}).siblings().css({"color":"#808080","border-bottom":"none"})
       		})
       	})
    </script>
@endsection